<?php
/**
 * NOTICE OF LICENSE
 *
 * THIS SOURCE FILE IS PART OF EVEBIT'S PRIVATE PROJECT.
 * 
 * DO NOT USE THIS FILE IN OTHER PLACE.
 *
 * @category  China Wanderer
 * @package   Default
 * @author    Chen Qiao <chen.qiao@evebit.com>
 * @version   $$Id: index.phtml 1372 2011-06-20 09:24:33Z chen.qiao $$
 * @copyright Copyright (c) 2011 Evebit Inc. China (http://www.evebit.com)
 */
?>
<script type="text/javascript">
	$(document).ready(function(){
		$("#RegisterForm").validationEngine();

		$("#register_paypal").click(function(){
            var username = $('#data_username').val();
            var email = $('#data_email').val();
            var password = $('#data_password').val();
            var confirm_password = $('#data_confirm_password').val();
            if(!username || !email || !password || !confirm_password){
                return false;
            }
            var data = 'data[username]='+username;
                data += '&data[email]='+email;
                data += '&data[password]='+password;
                data += '&data[confirm_password]='+confirm_password;
                data += '&data[select_role]=Entrepenuer';
                data += '&isAjax='+true;
            var url = <?php echo $this->baseUrl('')?>+'user/index/register';
            $.ajax({
			   type: "POST",
			   url: url,
			   data: data,
			   success: function(msg){
			        alert( "Data Saved: " + msg );
			        $('input[name=custom]').val(msg);
			        $('#paypal_form').submit();
			   }
		    }); 
        })
	})
</script>
<!-- begin Entrepenuer Register-->

<div class="user_edit_wrapper">
  <div class="reg_leftCol">
    <div class="reg_ent_banner"> </div>
    <div class="user_edit">
      <form method="post" id="RegisterForm" action="##" enctype="multipart/form-data">
        <div class="user_edit_block">
          <div class="user_edit_block_lable">&nbsp;</div>
          <div class="user_edit_block_input" id="user_edit_title">Register Premium Entrepreneur</div>
        </div>
        <div class="user_edit_block">
          <div class="user_edit_block_lable">Business Name</div>
          <div class="user_edit_block_input">
            <input type="text" name="data[username]" id="data_username" class="validate[brequired,slength[6]]"/>
          </div>
        </div>
        <div class="user_edit_block" id="user_edit_block_password">
          <div class="user_edit_block_lable">Email</div>
          <div class="user_edit_block_input">
            <input type="text" name="data[email]" id="data_email" class="validate[required,custom[email]]">
          </div>
        </div>
        <div class="user_edit_block">
          <div class="user_edit_block_lable">Password</div>
          <div class="user_edit_block_input">
            <input type="password" name="data[password]" id="data_password" style="color:#000000;" class="validate[required,slength[6]]">
          </div>
        </div>
        <div class="user_edit_block">
          <div class="user_edit_block_lable">Confirm password</div>
          <div class="user_edit_block_input">
            <input type="password" name="data[confire-password]" id="data_confirm_password" style="color:#000000;" class="validate[required,confirm[data_password]]"/>
          </div>
        </div>
      </form>
      <div class="user_edit_block">
        <div class="user_edit_block_lable">&nbsp;</div>
        <div class="user_edit_block_input">
          <input type="hidden" value="Entrepenuer" name="data[select_role]"/>
          <input type="submit" name="submit" id="register_paypal" value="Register and Pay" />
        </div>
      </div>
    </div>
  </div>
  <div class="video_box"></div>
</div>
<div class="clear_fix"></div>
<!-- End Entrepenuer Register-->

</div>
<!-- END OF TOP_HEADER -->

</div>
<!-- END OF FULL WIDTH HOME TOP -->

</div>
<!-- END OF WRAPPER -->

<?php $paypalUrl = $this->paypalAccount == 'xxxxxx_1311918233_biz@gmail.com'?'www.sandbox.paypal.com':'www.paypal.com'?>
<form name="_xclick" action="https://<?php echo $paypalUrl?>/cgi-bin/webscr" method="post" id="paypal_form">
  <!-- <form name="_xclick" id="paypal_form" action="<?php echo $this->baseUrl('/bbling/index/paypal-buy-now')?>" method="post"> -->
  <input type="hidden" name="cmd" value="_xclick">
  <input type="hidden" name="business" value="<?php echo $this->paypalAccount?>">
  <input type="hidden" name="item_name" value="Investors and Funding">
  <input type="hidden" name="item_number" value="1"/>
  <input type="hidden" name="currency_code" value="GBP">
  <input type="hidden" name="custom" value="">
  <input type="hidden" name="amount" value="<?php echo $this->paypalFee?>">
  <input type="hidden" name="notify_url" value="<?php echo $this->fullBasePath.'/bbling/index/paypal-notify'?>" />
  <input type="hidden" name="return" value="<?php echo $this->fullBasePath.'/' ?>">
</form>
